
function processModel(srcModel,
                      srcModelId,
                      srcDate,
                      srcRef,
                      srcNo,
                      serNumber){

  srcModel    = document.getElementsByName(srcModel);
  srcModelId  = document.getElementsByName(srcModelId);
  srcDate     = document.getElementsByName(srcDate);
  srcRef      = document.getElementsByName(srcModel);
  srcNo       = document.getElementsByName(srcNo);
  serNumber   = document.getElementsByName(serNumber);
  
  if(srcModel.length > 0){
    
    srcModel = srcModel[0];
  }
  
  if(srcModelId.length > 0){
    
    srcModelId = srcModelId[0];
  }
  
  if(srcDate.length > 0){
    
    srcDate = srcDate[0];
  }
  
  if(srcRef.length > 0){
    
    srcRef = srcRef[0];
  }
  
  if(srcNo.length > 0){
    
    srcNo = srcNo[0];
  }
  
  if(serNumber.length > 0){
    
    serNumber = serNumber[0];
  }
  
  
}

/**
* miniInput dialog
*
* @param  String  srcHostIp
* @param  String  srcQuantity
* @param  String  srcVarName
* @param  integer srcDtlNo
* @param  integer srcSubNo
*
*/
function miniInput(srcHostIp,
                   srcQuantity,
                   srcVarName,
                   srcDtlNo,
                   srcSubNo){

  var _1ST                = 0;
  var _2ND                = 1;
  var _COMMA_SEPARATOR    = ",";
  var _SMALLER            = 200;
  var _BASE_HTML          = "http://"+ srcHostIp +"/ecs/tocmenu_44/views/miniInput_html.php";
  var _TYPE_PO            = 1;
  var _DEFAULT_SEPARATOR  = "~^~";
  var _MANUAL_KEY_IN      = "_MANUAL_KEY_IN";
  
  var prevEntry = "";
  var checker   = document.getElementsByName(srcVarName);
  
  if(checker.length > 0){
    
    checker = checker[0];
  }
  
  if(checker.value.length > 0){
    
    /**
    * extract the jobId
    *
    */
    var srcJobId = checker.value.split(_DEFAULT_SEPARATOR);

    if(srcJobId[_1ST] == _MANUAL_KEY_IN){
      
      prevEntry = srcJobId[_2ND];
    }else{
      
      prevEntry = "";
    }
  }else{
    
    prevEntry = "";
  }
  
  /**
  * Fetch the opener properties
  *
  */
  var _HEIGHT = 250 + _COMMA_SEPARATOR;
  var _WIDTH  = 220 + _COMMA_SEPARATOR;
  
  hdlChild = window.open((_BASE_HTML + 
                          "?varName="     + srcVarName  +
                          "&srcQuantity=" + srcQuantity +
                          "&prevEntry="   + prevEntry   +
                          "&DTL_NO="      + srcDtlNo    + 
                          "&SUB_NO="      + srcSubNo),
                         
                         "miniInput",
                         ("height=" + _HEIGHT + 
                          "width="  + _WIDTH  + 
                          "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0"));
}

/**
* miniView dialog
*
* @param  String  srcHostIp
* @param  String  srcVarName
* @param  integer srcDtlNo
* @param  integer srcSubNo
*
*/
function miniView(srcHostIp,
                  srcVarName,
                  srcDtlNo,
                  srcSubNo){
  
  var _1ST                = 0;
  var _2ND                = 1;
  var _SEPARATOR_2ND      = "~^~";
  var _COMMA_SEPARATOR    = ",";
  var _SMALLER            = 200;
  var _BASE_HTML          = "http://"+ srcHostIp +"/ecs/tocmenu_44/views/miniView_html.php";
  var _TYPE_PO            = 1;
  var _DEFAULT_SEPARATOR  = "~^~";
  var _MANUAL_KEY_IN      = "_MANUAL_KEY_IN";
  
  /**
  * Fetch the opener properties
  *
  */
  var _HEIGHT = 250 + _COMMA_SEPARATOR;
  var _WIDTH  = 220 + _COMMA_SEPARATOR;
  
  var srcJid = document.getElementsByName(srcVarName);
  
  if(srcJid.length > 0){
    
    srcJid = srcJid[0];
  }
  
  srcJid = srcJid.value.split(_SEPARATOR_2ND);
  
  hdlChild = window.open((_BASE_HTML + 
                          "?varName="     + srcVarName   +
                          "&prevEntry="   + srcJid[_2ND] +
                          "&DTL_NO="      + srcDtlNo),
                         
                         "miniView",
                         ("height=" + _HEIGHT + 
                          "width="  + _WIDTH  + 
                          "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0"));
}

/**
* This is a test Function
* to test if the include is success
*
* @param  void
*
*/
function sayHelloMisc(){
  
  alert("misc.js is linked");
}
